
<meta charset="utf-8" />	
<form class="form-horizontal" role="form"  onsubmit="return submitForm(this);"
 action="mpomng/merProfitRuleAdd/add.do" >
 <br/>
	<div class="form-group">
		<label class="col-sm-3 control-label no-padding-right"
			for="form-field-1">分润类型: </label>
		<div class="col-sm-9">
				<select 
						rel="obj.PROFIT_TYPE"
			 			location="local" 
						name="profitType" 
			 			id="add_profitType" 
			 			data-placeholder="请选择分润类型" style="width: 100px;vertical-align:middle;">
					<option value='' >--请选择--</option>
			 	</select>
		</div>
	</div>
	
	<div class="form-group">
		<label class="col-sm-3 control-label no-padding-right"
			for="form-field-1"> 商户等级: </label>
		<div class="col-sm-9">
			<select 
			        rel="obj.options" valName="" textName=""
					location="mprcs/selectoption/custLevel.do" 
					name="custClass"
					id="add_custClass" 
					data-placeholder="请选择商户等级" style="width: 100px; vertical-align: middle;">
					<option value=''>--请选择--</option>
				</select>
		</div>
	</div>
	
	
	<div class="form-group">
		<label class="col-sm-3 control-label no-padding-right"
			for="form-field-1"> 分润比（%）： </label>
		<div class="col-sm-9">

			<input type="text" id="ratePercent" name="ratePercent" placeholder="请输入[分润比]" 
				class="col-xs-10 col-sm-7"  />
		</div>
	</div>
	<div class="form-group">
		<label class="col-sm-3 control-label no-padding-right"
			for="form-field-1"> 封顶（元）： </label>
		<div class="col-sm-9">

			<input type="text" id="rateTop" name="rateTop" placeholder="请输入[封顶]" 
				class="col-xs-10 col-sm-7"  />
		</div>
	</div>
	
	<div class="form-actions align-right  form-button-box" style="margin-top: 10px">
			<button class="btn btn-info" type="submit">
				保存
			</button>

			&nbsp; 
			<button class="btn" type="button" onclick="javascript:dialog.close(this);">
				 关闭
			</button>
		</div>
	
</form>
<script type="text/javascript">


$(document).ready(function() {
	
});

function submitForm(obj){
	var profitType=$("#add_profitType option:selected").val();
	if(profitType==''){
		alertMsg.error('请选择分润类型'); 
		return false;
	}
	
	var custClass=$("#add_custClass option:selected").val();
	if(custClass==''){
		alertMsg.error('请选择商户等级'); 
		return false;
	}
	
	//自定义匿名回调函数。 系统默认回调函数：dialogAjaxDone
	return validateCallback(obj,function(result){
		if(result.rspcod== 200){
			msg.alert("提示", result.rspmsg, 'correct');
			$("#grid-table").trigger("reloadGrid");
			dialog.close(obj);
		}else{
			msg.alert("错误", result.rspmsg + " 错误代码："
					+ result.rspcod, 'error');
		}
	});
}

</script>
